package com.xique.system.service.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xique.common.core.utils.DateUtils;
import com.xique.system.bean.domain.SystemNotice;
import com.xique.system.mapper.SystemNoticeMapper;
import com.xique.system.service.service.ISystemNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 后台系统公告Service业务层处理
 * 
 * @author xique
 * @date 2022-06-09
 */
@Service
public class SystemNoticeServiceImpl extends ServiceImpl<SystemNoticeMapper,SystemNotice> implements ISystemNoticeService
{
    @Autowired
    private SystemNoticeMapper systemNoticeMapper;

    /**
     * 查询后台系统公告
     * 
     * @param id 后台系统公告ID
     * @return 后台系统公告
     */
    @Override
    public SystemNotice selectSystemNoticeById(Long id)
    {
        return systemNoticeMapper.selectSystemNoticeById(id);
    }

    /**
     * 查询后台系统公告列表
     * 
     * @param systemNotice 后台系统公告
     * @return 后台系统公告
     */
    @Override
    public List<SystemNotice> selectSystemNoticeList(SystemNotice systemNotice)
    {
        return systemNoticeMapper.selectSystemNoticeList(systemNotice);
    }

    /**
     * 新增后台系统公告
     * 
     * @param systemNotice 后台系统公告
     * @return 结果
     */
    @Override
    public int insertSystemNotice(SystemNotice systemNotice)
    {
        systemNotice.setCreateTime(DateUtils.getNowDate());
        return systemNoticeMapper.insertSystemNotice(systemNotice);
    }

    /**
     * 修改后台系统公告
     * 
     * @param systemNotice 后台系统公告
     * @return 结果
     */
    @Override
    public int updateSystemNotice(SystemNotice systemNotice)
    {
        systemNotice.setUpdateTime(DateUtils.getNowDate());
        return systemNoticeMapper.updateSystemNotice(systemNotice);
    }

    /**
     * 批量删除后台系统公告
     * 
     * @param ids 需要删除的后台系统公告ID
     * @return 结果
     */
    @Override
    public int deleteSystemNoticeByIds(Long[] ids)
    {
        return systemNoticeMapper.deleteSystemNoticeByIds(ids);
    }

    /**
     * 删除后台系统公告信息
     * 
     * @param id 后台系统公告ID
     * @return 结果
     */
    @Override
    public int deleteSystemNoticeById(Long id)
    {
        return systemNoticeMapper.deleteSystemNoticeById(id);
    }
}
